const webpack = require('webpack');
const paths = require('./paths');
const entry = require('./entry.js');

const output = { // 项目输出目录和文件
    path: paths.BUILD_PATH,
    filename: '[name]-[hash].js',
};

const rules = {}; // loader
const plugins = [ // 插件
    new webpack.optimize.CommonsChunkPlugin({
        name: 'vendor',
        filename: 'vendor-[hash].js',
    }),
    new webpack.optimize.UglifyJsPlugin(),
];

module.exports = {
    entry,
    output,
    plugins,
};
